package jspservlet.servlet;
import java.io.IOException;
//import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import jspservlet.dao.DeviceDAO;
import jspservlet.dao.impl.DeviceDAOImpl;
import jspservlet.vo.Fan;
import jspservlet.vo.Connection;


public class ChangeFanStateServelt {
     public void doGet(HttpServletRequest req,HttpServletResponse res) 
		throws IOException,ServletException{
	}

	public void doPost(HttpServletRequest req,HttpServletResponse res) 
			throws IOException,ServletException{
        DeviceDAO dao = new DeviceDAOImpl();
        Fan fan = new Fan();
        

         fan.setIdDevice(req.getParameter("deviceid"));
         fan.setGear(Integer.parseInt(req.getParameter("newpsw")));
        //输入设备id
        try {
            int flag = dao.changeFanGear(fan);
        } catch (Exception e) {
            e.printStackTrace();
        } 

    }
}




